﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Globalization;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;
using ncp.Business;

namespace ncp.Web.cms
{
    public partial class LogHandle_List : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(LogHandle_List));
        }

        //得到总记录数
        [AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)]
        public int GetRecordCount(string currentwhere)
        {
            return LogHandleBll.GetLogHandleCount(currentwhere, CommonConst.DB_Name);
        }

        //装载商品表视图
        [AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)]
        public string BindTable(string jsonData)
        {
            Dictionary<string, object> DictList = JsonHelper.JSONToObject<Dictionary<string, object>>(jsonData);
            DataTable dt = LogHandleBll.GetHandleLogTable(int.Parse(DictList["currentpageindex"].ToString()) - 1, int.Parse(DictList["pagesize"].ToString()), "*", DictList["sorting"].ToString() + " " + DictList["sortdir"].ToString(), DictList["currentwhere"].ToString(), CommonConst.DB_Name);
            return  JsonHelper.DataTableToJSON(dt);
        }

    }
}
